/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.toools.gwt.wmc.client.application;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import java.util.Collection;
import org.toools.gwt.wmc.jpa.Application;

/**
 *
 * @author manuel
 */
public interface ApplicationService extends RemoteService{

    public static class Util {
		private static ApplicationServiceAsync instance;
		public static ApplicationServiceAsync getInstance(){
			if (instance == null) {
				instance = (ApplicationServiceAsync) GWT.create(ApplicationService.class);
				ServiceDefTarget target = (ServiceDefTarget) instance;
				target.setServiceEntryPoint(GWT.getHostPageBaseURL() + "WMC/ApplicationService");
			}
			return instance;
		}
	}

    Application getApplicationByID( Integer id );
    Collection<Application> getApplications();

    Application create( Application a );
    Boolean delete( Application a );
    Boolean update( Application a );

}
